home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacApp Release 10 / MacApp Release 10 - HD Ready / Libraries / App / Sources / UDebugView.cp < prev    next >
Encoding:
Text File  |  1996-04-03  |  4.9 KB  |  181 lines  |  [TEXT/MPS ]

  1. //----------------------------------------------------------------------------------------
  2. // UDebugView.cp
  3. // Copyright © 1984-96 by Apple Computer, Inc. All rights reserved.
  4. //----------------------------------------------------------------------------------------
  5.  
  6. #if qDebug
  7.  
  8. #ifndef __UDEBUGVIEW__
  9. #include "UDebugView.h"
  10. #endif
  11.  
  12. // MacApp
  13.  
  14. #ifndef __UDEBUG__
  15. #include "UDebug.h"
  16. #endif
  17.  
  18. #ifndef __UDIALOG__
  19. #include "UDialog.h"
  20. #endif
  21.  
  22. #ifndef __USEGMENTS__
  23. #include "USegments.h"
  24. #endif
  25.  
  26. // Toolbox
  27.  
  28. // ANSI
  29.  
  30. //========================================================================================
  31. // CLASS TDebugFlagsView
  32. //========================================================================================
  33. #undef Inherited
  34. #define Inherited TView
  35.  
  36. #pragma segment MADebugger
  37. MA_DEFINE_CLASS_M1(TDebugFlagsView, Inherited);
  38.  
  39. //----------------------------------------------------------------------------------------
  40. // TDebugFlagsView: Empty constructor to satisfy the compiler.
  41. //----------------------------------------------------------------------------------------
  42. #pragma segment ConstructorRes
  43.  
  44. TDebugFlagsView::TDebugFlagsView()
  45. {
  46. } // TDebugFlagsView::TDebugFlagsView
  47.  
  48. //----------------------------------------------------------------------------------------
  49. // TDebugFlagsView destructor
  50. //----------------------------------------------------------------------------------------
  51. #pragma segment MADestructorRes
  52.  
  53. TDebugFlagsView::~TDebugFlagsView()
  54. {
  55. }
  56.  
  57.  
  58. //----------------------------------------------------------------------------------------
  59. // TDebugFlagsView::DoEvent:
  60. //----------------------------------------------------------------------------------------
  61. #pragma segment MADebugger
  62.  
  63. void TDebugFlagsView::DoEvent(EventNumber eventNumber,
  64.                                      TEventHandler* source,
  65.                                      TEvent* event)
  66. {
  67.     if (eventNumber == mCheckBoxHit)
  68.     {
  69.         switch (source->fIdentifier)
  70.         {
  71.             case 'usr1':
  72.                 gUserFlag1 = !gUserFlag1;
  73.                 break;
  74.                 
  75.             case 'usr2':
  76.                 gUserFlag2 = !gUserFlag2;
  77.                 break;
  78.                 
  79.             case 'usr3':
  80.                 gUserFlag3 = !gUserFlag3;
  81.                 break;
  82.                 
  83.             case 'focu':
  84.                 gAssumeFocused = !gAssumeFocused;
  85.                 break;
  86.  
  87.             case 'prnt':
  88.                 gDebugPrinting = !gDebugPrinting;
  89.                 break;
  90.                 
  91.             case 'ints':
  92.                 gIntenseDebugging = !gIntenseDebugging;
  93.                 break;
  94.                 
  95.             case 'evnt':
  96.                 gReportEvent = !gReportEvent;
  97.                 break;
  98.                 
  99.             case 'menu':
  100.                 gReportMenuChoices = !gReportMenuChoices;
  101.                 break;
  102.                 
  103.             case 'curs':
  104.                 gShowCursorRegion = !gShowCursorRegion;
  105.                 break;
  106.                 
  107.             case 'help':
  108.                 gShowHelpRegion = !gShowHelpRegion;
  109.                 break;
  110.                 
  111.             case 'invl':
  112.                 gShowInvalidations = !gShowInvalidations;
  113.                 break;
  114.                 
  115.             case 'slee':
  116.                 gShowSleepRegion = !gShowSleepRegion;
  117.                 break;
  118.                 
  119.             case 'memb':
  120.                 gMemMgtBreak = !gMemMgtBreak;
  121.                 break;
  122.                 
  123.             case 'rsrc':
  124.                 gRsrcReport = !gRsrcReport;
  125.                 break;
  126.                 
  127.             case 'segl':
  128.                 gSegReport = !gSegReport;
  129.                 break;
  130.                 
  131. #if qSegments
  132.             case 'segu':
  133.                 gUnloadAllSegs = !gUnloadAllSegs;
  134.                 break;
  135. #endif
  136.         }
  137.     }
  138.     else
  139.         Inherited::DoEvent(eventNumber, source, event);
  140. } // DoEvent::DoEvent
  141.  
  142.  
  143. //----------------------------------------------------------------------------------------
  144. // TDebugFlagsView::DoPostCreate:
  145. //----------------------------------------------------------------------------------------
  146. #pragma segment MADebugger
  147.  
  148. void TDebugFlagsView::DoPostCreate(TDocument* itsDocument)
  149. {
  150.     Inherited::DoPostCreate(itsDocument);
  151.  
  152.     // Synchronize the global flags and the check boxes used to set toggle them.
  153.     
  154.     ((TCheckBox *) this->FindSubView('usr1'))->SetState(gUserFlag1, FALSE);
  155.     ((TCheckBox *) this->FindSubView('usr2'))->SetState(gUserFlag2, FALSE);
  156.     ((TCheckBox *) this->FindSubView('usr3'))->SetState(gUserFlag3, FALSE);
  157.     ((TCheckBox *) this->FindSubView('focu'))->SetState(gAssumeFocused, FALSE);
  158.     ((TCheckBox *) this->FindSubView('prnt'))->SetState(gDebugPrinting, FALSE);
  159.     ((TCheckBox *) this->FindSubView('ints'))->SetState(gIntenseDebugging, FALSE);
  160.     ((TCheckBox *) this->FindSubView('evnt'))->SetState(gReportEvent, FALSE);
  161.     ((TCheckBox *) this->FindSubView('menu'))->SetState(gReportMenuChoices, FALSE);
  162.     ((TCheckBox *) this->FindSubView('curs'))->SetState(gShowCursorRegion, FALSE);
  163.     ((TCheckBox *) this->FindSubView('help'))->SetState(gShowHelpRegion, FALSE);
  164.     ((TCheckBox *) this->FindSubView('invl'))->SetState(gShowInvalidations, FALSE);
  165.     ((TCheckBox *) this->FindSubView('slee'))->SetState(gShowSleepRegion, FALSE);
  166.     ((TCheckBox *) this->FindSubView('memb'))->SetState(gMemMgtBreak, FALSE);
  167.     ((TCheckBox *) this->FindSubView('rsrc'))->SetState(gRsrcReport, FALSE);
  168.     ((TCheckBox *) this->FindSubView('segl'))->SetState(gSegReport, FALSE);
  169. #if qSegments
  170.     ((TCheckBox *) this->FindSubView('segu'))->SetState(gUnloadAllSegs, FALSE);
  171. #endif    
  172.     
  173. } // TDebugFlagsView::DoPostCreate
  174.  
  175. #endif // qDebug
  176.  
  177. //----------------------------------------------------------------------------------------
  178. // End of UDebugView.cp
  179.  
  180. #pragma segment Inline
  181.